<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:sec="http://www.springframework.org/security/facelets/tags"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:jsflot="http://www.jsflot.org/taglib/jsflot"
                xmlns:d="http://java.sun.com/jsf/demo/ components"
				template="/WEB-INF/layouts/template.xhtml">

<ui:define name="main">
<script type="text/javascript">document.getElementById('menuMembers').className="selected";</script>
<div id="main">
	<div id="wrapper" class="yui-b">
		<h3 class="title">${msg.title_member}</h3>
		<div id="mainContent">
			<h:form id="members">
			    <h:dataTable id="members" styleClass="summary" value="${members}" var="m" rendered="${members.rowCount > 0}" >
			    	<h:column >
			    		<f:facet name="header"></f:facet>
			    		<a4j:mediaOutput element="img" createContent="${imageBean.paintMember}" value="${m.photo}" cacheable="false" mimeType="${imageFileUpload.mimeType}" styleClass="userimage" />
			    	</h:column>
			    	<h:column >
			    		<f:facet name="header">${msg.name}</f:facet>
			    		<sf:commandLink id="viewClientLink" action="select">${m.contact.name}</sf:commandLink>
			    	</h:column>
			    </h:dataTable>
			    <h:outputText value="${msg.member_noMembers}" rendered="${members.rowCount == 0}"/>
			    <div style="clear: both; height: 5px;" />
				<sec:ifAnyGranted roles="ROLE_ADMIN">
				    <div>
			    		<sf:commandLink id="add" action="add"><div class="button">${msg.add} ${msg.member}</div></sf:commandLink>
			    	</div>
		    	</sec:ifAnyGranted>
		    	<div style="clear: both; height: 5px;" />
		    </h:form>
		</div>
	</div>
</div>
</ui:define>
</ui:composition>